import proFetch from "../../../../../../public/functions/project-fetch";
import {toast} from 'nc-lightapp-front'
import saveInnerTransData from "./saveInnerTransData";

export default function checkInnerTransData() {
    const {orgVal, form, table} = this.props;
    const param_str = table.getCheckedRows('info').map(item => item.data.values.pk_psnjob.value).join();
    let postData = {
        param_str,
        pk_org: orgVal.refpk,
        model: form.getAllFormValue('innertrans')
    };

    return proFetch({
        url: '/nccloud/hrtrn/dimissionrds/DimissionRdsTransCheckAction.do',
        body: postData,
    })
        .then((res) => {
            if (res.success) {
                const {confirmMsg, passPKs, warningMsg} = res.data;
                this.alertModalNode.show(confirmMsg, warningMsg, () => {
                    saveInnerTransData.call(this, passPKs);
                })
            }
        });
}
